package view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;

/**
 * Created by eyesee on 2017/4/20.
 */

public class FocusLinearLayout extends LinearLayout{

    public FocusLinearLayout(Context context) {
        super(context);
        init();
    }

    public FocusLinearLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public FocusLinearLayout(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }

    private void init() {
        setClickable(true);

        setFocusable(true);
        setFocusableInTouchMode(true);

        requestFocus();
        requestFocusFromTouch();
    }

}
